#ifndef CAMERA_H
#define CAMERA_H


// trying a more Qt style get/set function style :)

/// wow i could have used a rect... oh well its done now :) lol!! well it will look cooler when i make the
/// instance ( Camera myCamera vs Rect myCamera )
class Camera
{
public:
    Camera();
    Camera(int x, int y, int width, int height);
    ~Camera();

    inline int left()   { return myLeft; }
    inline int right()  { return myLeft + myWidth; }
    inline int top()    { return myTop; }
    inline int bottom() { return myTop + myHeight; }
    inline int width()  { return myWidth; }
    inline int height() { return myHeight; }

    bool needsUpdate() { return myUpdate; }

    inline bool contains(int x, int y)
    {
        return ( x > left()&& x < right() &&
                 y > top() && y < bottom() );
    }

    void Updated()                  { myUpdate = false; }
    void move(int offX, int offY)   { myLeft += offX; myTop += offY; myUpdate = true; }
    void setPosition(int x, int y)  { myLeft = x; myTop = y; myUpdate = true; }
    void setSize(int w, int h)      { myWidth = w; myHeight = h; myUpdate = true; }
    void setLeft(int left)          { myLeft = left; myUpdate = true; }
    void setTop(int top)            { myTop = top; myUpdate = true; }
    void setWidth(int width)        { myWidth = width; myUpdate = true; }
    void setHeight(int height)      { myHeight = height; myUpdate = true; }


private:
    bool myUpdate;
    int myLeft, myTop;
    int myWidth, myHeight;
};

#endif // CAMERA_H
